# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=geoip2-database
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=20150720
pkgrel=1
pkgdesc="GeoLite country geolocation database compiled by MaxMind (mingw-w64)"
arch=('any')
url="https://www.maxmind.com/en/geoip2-services-and-databases"
license=('custom:Creative Commons Attribution-ShareAlike 3.0 Unported')
source=(GeoLite2-Country-${pkgver}.mmdb.gz::https://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz
        #GeoLite2-City-${pkgver}.mmdb.gz::https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz
        )
sha256sums=('4819459376f61423f5fb96eff141bf486d8e6133c47acd832d2ba87a39f2a922')

prepare() {
  cd "${srcdir}"
  mv GeoLite2-Country-${pkgver}.mmdb GeoLite2-Country.mmdb
}

package() {
  cd "${srcdir}"

  install -d "${pkgdir}${MINGW_PREFIX}/share/GeoIP2"
  install -m644 -t "${pkgdir}${MINGW_PREFIX}/share/GeoIP2" GeoLite2-Country.mmdb
}
